#ifndef __valve_H
#define __valve_H

#include <stdint.h>

#define	REG_VALVE_BAS_ADDR  800 

enum 
{
  ch1_pwm,
	ch2_pwm,
	ch3_pwm,
	ch4_pwm,
	ch1_pw,
	ch2_pw,
	ch3_pw,
	ch4_pw,
	ch1_sw,
  ch2_sw,
  ch3_sw,
  ch4_sw,
  
  bat_v,

  ch1_p,
  ch2_p,
  ch3_p,
  ch4_p,
};

struct S_REG_VALVE
{
  uint16_t ch1_pwm;
	uint16_t ch2_pwm;
	uint16_t ch3_pwm;
	uint16_t ch4_pwm;
	uint16_t ch1_pw;
	uint16_t ch2_pw;
	uint16_t ch3_pw;
	uint16_t ch4_pw;
	uint16_t ch1_sw;
  uint16_t ch2_sw;
  uint16_t ch3_sw;
  uint16_t ch4_sw;
  
  uint16_t bat_v;

  uint16_t ch1_p;
  uint16_t ch2_p;
  uint16_t ch3_p;
  uint16_t ch4_p;
};

extern struct S_REG_VALVE s_reg_valve;

uint16_t get_valve_state(void);
uint8_t valve_task(void) ; 
uint8_t  sw_valve(uint16_t reg_addr_index, uint16_t msg);
#endif
